export {}
type myParamType = string|number;

function sayHi(p:myParamType){
    console.log(p);
}

const p1:string ="123" 
sayHi(p1)

const p2:number =123 
sayHi(p2)

type EventName ='click'|'select'|boolean

function handleEvent(ele: string, event: EventName) {
    
    console.log(`${ele},触发了 ${ event} 事件`);
}


handleEvent("div",'click')
handleEvent("div",'select')
handleEvent("div",'focus')
handleEvent("button",'click')
handleEvent('div',false)



